LIBDIR = ../lib

#CC = gcc
CC = g++
CFLAGS = -g -Wall

.c.o:
	$(CC) $(CFLAGS) -c $<

.cc.o:
	$(CXX) $(CFLAGS) -c $<

HEADERS = a48.h mesh.h patch.h face.h edge.h vertex.h heap.h vec3.h rply.h camera.h

SOURCES = mesh.cc edge.cc patch.cc face.cc heap.cc ply.cc rply.c camera.cc

OBJECTS = mesh.o edge.o patch.o face.o heap.o ply.o rply.o camera.o

LIBNAME = libmesh.a

$(LIBNAME): $(HEADERS) $(OBJECTS)
	ar ruv $(LIBNAME) $(OBJECTS)
	ranlib $(LIBNAME)

$(OBJECTS):  $(HEADERS)

install: $(LIBNAME)
	mv $(LIBNAME) $(LIBDIR)

clean:
	rm -f *.o *~ $(LIBNAME)



